<template>
  <div>
    <mycate :data="data" />
  </div>
</template>

<script>
import mycate from "./mycate.vue";
export default {
  components: { mycate },
  data() {
    return {
      data: {},
    };
  },
  mounted() {
    this.get_data();
  },
  methods: {
    get_data() {
      this.axios.get("http://127.0.0.1:8000/get_cate/")
      .then((res) => {
        console.log(res.data);
        var mytree = { id: 0, name: "" };
        mytree["children"] = res.data;
        this.data = mytree;
      })
      .catch(err=>{
          console.log(err)
      })
    },
  },
  created() {},
};
</script>

<style>
</style>